Repository navigation
Explain the data folders bundlers don't copy - #5
Merged
Merged
Conversation
List what breaks without them in Vite, webpack 5 and Next.js builds, and give a postinstall script that copies the package's dist folder for assets-base, with a variant for CI that skips install scripts. CCITT images also need the WASM decoders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 tasks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alekswebnet
marked this pull request as ready for review
November 1, 2026 12:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pairs with missing-elements/pdfjs-viewer#70, released in pdfjs-viewer 4.4.2. The copy script resolves
@missing-elements/pdfjs-viewer/package.json, which 4.4.2 exports, and the Next.js claims depend on its fixes.assets-base: names Next.js (webpack or Turbopack) next to Vite and webpack 5. It lists what breaks without the PDF.js data folders, and gives apostinstallscript that copiesdistintopublic/pdfjs-viewer/forassets-base. For CI that skips install scripts, it shows how to run the copy frombuildinstead.@missing-elements/pdfjs-viewerto 4.4.2, so the live preview and the version numbers come from that release.Validation:
pnpm build(Eleventy) passes, and#bundlers-and-assets-baseresolves.import.meta.resolve('@missing-elements/pdfjs-viewer/package.json')resolves against the published 4.4.2.postinstallin Next.js 16.4.3 (Turbopack and webpack) and Vite 8.3.5 builds withassets-base="/pdfjs-viewer/". With the copy, JBIG2, CCITT and JPEG 2000 scans, CJK text in a non-embedded font, PDF JavaScript and note icons all work. Without it, they all fail.🤖 Generated with Claude Code